package drds.global_transaction.api.rpc.rpc_message;

import lombok.Getter;
import lombok.Setter;

import java.util.concurrent.atomic.AtomicLong;

/**
 * 客户端和服务器端通过此进行交互
 */
public class RpcInfo
{

	private static AtomicLong nextId = new AtomicLong(0);

	public static long getNextMessageId()
	{
		return nextId.incrementAndGet();
	}

	@Setter
	@Getter
	private long id;
	@Setter
	@Getter
	private boolean synchronous;
	@Setter
	@Getter
	private boolean isRequest;
	@Setter
	@Getter
	private boolean isHeartbeat;

	/**
	 * 真正的消息内容
	 */
	@Setter
	@Getter
	private Object message;
}
